home *** CD-ROM | disk | FTP | other *** search
/ Interactive Media Design Review 1999 / Interactive Media Design Review 1999.iso / pc / allfiles / angry / main.dir / 00011_Script_main_loop < prev    next >
Text File  |  1999-03-01  |  3KB  |  116 lines

  1. global gScroll
  2. global gUpScr, gDownScr
  3. global oldMouseP
  4. global drops
  5. global cursorSpr
  6.  
  7.  
  8.  
  9. on enterFrame
  10.   
  11.   -- main cursor
  12.   
  13.   set mouseP = point(the mouseH, the mouseV)
  14.   
  15.   if inside(mouseP, rect(0, 0, 640, 480)) then cursor 200
  16.   --  else cursor -1
  17.   
  18.   set diffP = mouseP - oldMouseP
  19.   
  20.   set horiz = getAt(diffP, 1)
  21.   set vert = getAt(diffP, 2)
  22.   
  23.   set drop = TRUE
  24.   
  25.   if horiz < -5 then
  26.     
  27.     if vert < -5 then
  28.       set the member of sprite(cursorSpr) to member "northwest"
  29.     else if vert > 5 then
  30.       set the member of sprite(cursorSpr) to member "southwest"
  31.     else
  32.       set the member of sprite(cursorSpr) to member "west"
  33.     end if
  34.     
  35.   else if horiz > 5 then
  36.     
  37.     if vert < -5 then
  38.       set the member of sprite(cursorSpr) to member "northeast"
  39.     else if vert > 5 then
  40.       set the member of sprite(cursorSpr) to member "southeast"
  41.     else
  42.       set the member of sprite(cursorSpr) to member "east"
  43.     end if
  44.     
  45.   else
  46.     
  47.     if vert < -5 then
  48.       set the member of sprite(cursorSpr) to member "north"
  49.     else if vert > 5 then
  50.       set the member of sprite(cursorSpr) to member "south"
  51.     else  
  52.       set the member of sprite(cursorSpr) to member "stop"
  53.       set drop = FALSE
  54.     end if
  55.     
  56.   end if
  57.   
  58.   set the loc of sprite cursorSpr to mouseP
  59.   
  60.   
  61.   
  62.   -- little droplets
  63.   
  64.   repeat with a = 1 to count(drops)
  65.     set doMe = getAt(drops, a)
  66.     check doMe
  67.   end repeat
  68.   
  69.   
  70.   if random(2) = 2 AND drop then
  71.     repeat with a = 1 to count(drops)
  72.       set doMe = getAt(drops, a)
  73.       if not(the pActiveDrop of doMe) then
  74.         drop doMe, cursorSpr
  75.         exit repeat
  76.       end if
  77.     end repeat
  78.   end if
  79.   
  80.   
  81.   set oldMouseP = point(the mouseH, the mouseV)
  82.   
  83.   -- scrolling
  84.   
  85.   
  86.   
  87.   if the mouseV > getAt(gUPScr, 1) AND the mouseV < getAt(gUpScr, 2) then
  88.     -- scroll Up
  89.     repeat with a = 1 to count(gScroll)
  90.       scroll getAt(gScroll, a), 1, 25
  91.     end repeat
  92.     repeat with a = 1 to count(drops)
  93.       scrollDrops getAt(drops, a), 1, 25    
  94.     end repeat
  95.     updatestage    
  96.   else if the mouseV > getAt(gDownScr, 1) AND the mouseV < getAt(gDownScr, 2) then
  97.     -- scroll Down
  98.     repeat with a = 1 to count(gScroll)
  99.       scroll getAt(gScroll, a), -1, 25
  100.     end repeat
  101.     repeat with a = 1 to count(drops)
  102.       scrollDrops getAt(drops, a), -1, 25    
  103.     end repeat
  104.     updateStage
  105.   end if
  106.   
  107.   
  108.   
  109.   
  110.   
  111.   
  112. end
  113.  
  114. on exitFrame
  115.   go to the frame
  116. end